//
//  YHSearchCollectionCell.m
//  FAKER
//
//  Created by dllo on 15/11/7.
//  Copyright © 2015年 YHLai. All rights reserved.
//

#import "YHSearchCollectionCell.h"
#import "FitHeader.h"

@implementation YHSearchCollectionCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        _titleLabel = [[UILabel alloc] initWithFrame:self.contentView.frame];
        _titleLabel.font = [UIFont systemFontOfSize:14];
        _titleLabel.textAlignment = NSTextAlignmentCenter;
//        _titleLabel.textColor = [UIColor grayColor];
        _titleLabel.layer.borderWidth = 1;
        _titleLabel.layer.cornerRadius = 15;
        _titleLabel.layer.borderColor = [UIColor lightGrayColor].CGColor;
        [self.contentView addSubview:_titleLabel];
        
        //添加夜间模式监听
        [self changeColor];
        ADD_NSNOTIFICATIONCENTER_OBSERVER;
    }
    return self;
}

#pragma mark 改变颜色
- (void)changeColor
{
    if (NSUSERDEFAULTS_NIGHT) {
        _titleLabel.textColor = [UIColor lightGrayColor];
    } else {
        _titleLabel.textColor = [UIColor grayColor];
    }
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
